package com.zp.io;

import java.io.RandomAccessFile;

public class Person {
	
	private int id;
	private String name;
	private double height;
	
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public double getHeight() {
		return height;
	}
	public void setHeight(double height) {
		this.height = height;
	}
	
	public Person()
	{

	}

	public Person(int id, String name, double height)
	{
		this.id = id;
		this.name = name;
		this.height = height;
	}

	public void write(RandomAccessFile raf) throws Exception
	{
		raf.writeInt(this.id);
		raf.writeUTF(this.name);
		raf.writeDouble(this.height);
	}

	public void read(RandomAccessFile raf) throws Exception
	{
		this.id = raf.readInt();
		this.name = raf.readUTF();
		this.height = raf.readDouble();
	}
}
